Namespace DataStream
    <Serializable()> _
    Public Class StreamCalculator
        Implements IStreamHandle, IStreamRecieve

#Region "Private Variables"
        Private mItems As New StreamCalculatorItemColection()
        Private mGetCurrentStream As DataStream.IStreamHandle.GetCurrentLog = Nothing
#End Region

#Region "Properties"
        Public ReadOnly Property CalculatorItemCollection() As StreamCalculatorItemColection
            Get
                Return mItems
            End Get
        End Property

        Public Property GetCurrentStreamLog() As IStreamHandle.GetCurrentLog Implements IStreamHandle.GetCurrentStreamLog
            Get
                Return mGetCurrentStream
            End Get
            Set(ByVal value As IStreamHandle.GetCurrentLog)
                mGetCurrentStream = value
            End Set
        End Property
#End Region

        Public Sub RefreshLog() Implements IStreamHandle.RefreshLog

        End Sub

        Public Sub RecieveStream(ByVal Stream As Stream) Implements IStreamRecieve.RecieveStream
            For Each item As StreamCalculatorItem In mItems
                If Not item.EvalObject Is Nothing Then
                    If item.EvalObject.Calculate(Stream) Then
                        ' Debug.Print("Calculated OK")
                    Else
                        ' Debug.Print("Calculated NOT OK")
                    End If
                End If
            Next
        End Sub

#Region "Events"
        Public Event RequestRefresh(ByVal sender As Object, ByVal e As System.EventArgs) Implements IStreamRecieve.RequestRefresh

        Public Event Restrict(ByVal sender As Object, ByVal e As StreamRestrictEventArgs) Implements IStreamRecieve.Restrict

        Public Event Seek(ByVal sender As Object, ByVal e As StreamSeekEventArgs) Implements IStreamRecieve.Seek
#End Region

        Public ReadOnly Property RecieverType() As DataStream.StreamRecieveType Implements DataStream.IStreamRecieve.RecieverType
            Get
                Return DataStream.StreamRecieveType.eStreamProducer
            End Get
        End Property
        Public Event Close(ByVal sender As Object, ByVal e As System.EventArgs) Implements IStreamRecieve.Close

        Public Sub RecieveSeek(ByVal Stream As Stream) Implements IStreamRecieve.RecieveSeek

        End Sub

        Public ReadOnly Property Name() As String Implements INamed.Name
            Get
                Return "BikiSoftStreamCalculator"
            End Get
        End Property
    End Class
End Namespace
